package com.coderman.basketball.statistics.context;

import java.util.Map;

/**
 * Description:
 * date: 2021/5/27
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
public class GamePlayerDataBO {

    private Long gameId;

    /**
     * 上场时间
     */
    private String onTime;

    /**
     * 球员ID
     */
    private Long playerId;

    /**
     * 当前比赛得分
     */
    private Integer score;


    /**
     * 所属球队名称
     */
    private String teamName;

    /**
     * 统计数据
     */
    private Map<String,Integer> statisMap;

    /**
     * 增加分数
     * @param score
     */
    public void incrScore(int score){
        this.score = score + this.score;
    }

    /**
     * 增加统计值
     * @param key
     * @param value
     */
    public void incrKeyValue(String key,int value){
        Integer oldValue = this.statisMap.get(key);
        if(oldValue == null){
            oldValue = value;
        }else {
            oldValue = oldValue + value;
        }
        this.statisMap.put(key,oldValue);
    }

}
